package com.wangijun.yuan.core.domain;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema;

import java.io.Serial;
import java.io.Serializable;
import java.time.LocalDateTime;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 评论表
 */
@Schema(description = "评论表")
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@TableName(value = "`comment`")
public class Comment implements Serializable {
    /**
     * 评论ID
     */
    @TableId(value = "id", type = IdType.ASSIGN_ID)
    @Schema(description = "评论ID")
    private Long id;

    /**
     * 父节点
     */
    @TableField(value = "parent_id")
    @Schema(description = "父节点")
    private Long parentId;

    /**
     * 回复ID
     */
    @TableField(value = "reply_id")
    @Schema(description = "回复ID")
    private Long replyId;

    /**
     * 文章ID
     */
    @TableField(value = "article_id")
    @Schema(description = "文章ID")
    private Long articleId;

    /**
     * 评论内容
     */
    @TableField(value = "content")
    @Schema(description = "评论内容")
    private String content;

    /**
     * 用户ID
     */
    @TableField(value = "user_id")
    @Schema(description = "用户ID")
    private Long userId;

    /**
     * 发评论时IP地址
     */
    @TableField(value = "address")
    @Schema(description = "发评论时IP地址")
    private String address;

    /**
     * 点赞数
     */
    @TableField(value = "likes")
    @Schema(description = "点赞数")
    private Integer likes;

    /**
     * 创建时间
     */
    @TableField(value = "create_time", fill = FieldFill.INSERT)
    @Schema(description = "创建时间")
    private LocalDateTime createTime;

    /**
     * 被举报次数
     */
    @TableField(value = "report_num")
    @Schema(description = "被举报次数")
    private Integer reportNum;
    @Serial
    private static final long serialVersionUID = 1L;
}